﻿using LPLS.Commons.DBModule;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LPLS.DBEntities.ConfigModels.DataCollectionConfigModule.DataCollectionType.DB
{

    [DatabaseKey(DatabaseEnum.CollectionConfigDB)]
    [SugarTable(nameof(DBVarColumnConfig))]
    /// <summary>
    /// 数据库变量属性配置  数据采集源为数据库
    ///此类用于配置数据库中的变量列属性
    /// </summary>
    public class DBVarColumnConfig
    {

        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int ID { get; set; }

        [SugarColumn(ColumnDescription = "字段名称")]
        public string DbColumnName { get; set;  }


        [SugarColumn(ColumnDescription = "字段类型")]
        public string DataType { get; set; }


        [SugarColumn(ColumnDescription = "字段长度")]
        public int Length { get; set; }

        [SugarColumn(ColumnDescription = "是否主键")]
        public bool IsPrimaryKey { get; set; } = false;

        [SugarColumn(ColumnDescription = "是否自增")]
        public bool IsIdentity { get; set; }

        [SugarColumn(ColumnDescription = "是否允许为空")]
        public bool IsNullable { get; set; }

        [SugarColumn(ColumnDescription = "Table名称ID")]
        public string TableID { get; set; }

    }
}
